package com.cuiyt.server.impl;

import com.cuiyt.domain.User;
import com.cuiyt.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cuiyt.server.UserService;

import java.util.List;

/**
 * @author cyt
 * @create 2020-08-02 20:08
 */
@Service("UserService")
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> getUserByName(String name) {
        System.out.println(name);
        List<User> users = this.userMapper.selectOne(name);
        System.out.println("从数据库获得= > ");
        return users;
    }

    @Override
    public void insertByUser(User user) {
        this.userMapper.insertUser(user.getName(), user.getPwd());
    }

}
